//
//  SRControlCenter.h
//  SecretRoom
//
//  Created by Sitdhibhong Laokok on 9/2/54 BE.
//  Copyright 2554 App Tree. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "SLCommonsFacebookConnect.h"

#import "Event.h"


typedef enum {
    kSRDateFormatterLong        = 0,
    kSRDateFormatterShort       = 1,
    kSRDateFormatterDatabase    = 2
} kSRDateFormatter;

@class Facebook, SLCommonsFacebookConnect;

@interface SRConnectionControlCenter : NSObject {
    NSManagedObjectContext *manageObjectContext;
    BOOL retryOnTimeOut;
    
    NSDateFormatter *defaultDateFormatterWithInDatabase;
    
    Facebook *facebook;
    
    SLCommonsFacebookConnect *commonsFacebookConnect;
}

@property (nonatomic, retain) NSManagedObjectContext *manageObjectContext;
@property (nonatomic, retain) NSDateFormatter *defaultDateFormatterWithInDatabase;

@property (nonatomic, retain) Facebook *facebook;
@property (nonatomic, retain) SLCommonsFacebookConnect *commonsFacebookConnect;

+ (SRConnectionControlCenter *)sharedInstance;
+ (NSString *)categoryStringWithCategory:(kSREventCategory)category;
+ (NSDateFormatter *)dateFormatterWithFormat:(kSRDateFormatter)formatterSelected;

- (id)initWithManagedObjectContext:(NSManagedObjectContext *)context;
- (void)notificationRegister;

- (NSDictionary *)authenticationToSecretRoomWithUsername:(NSString *)username password:(NSString *)password error:(NSError **)error;

- (NSString *)createNewEvent:(Event *)event error:(NSError **)error;

@end
